/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package org.sbbs.demo.async.future;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author jenkins
 */
public class UserInfoService {

    public UserInfo getUserInfo(Long userId) {
        try {
            Thread.sleep(300);//模拟调用耗时
        } catch (InterruptedException ex) {
            Logger.getLogger(UserInfoService.class.getName()).log(Level.SEVERE, null, ex);
        }
        return new UserInfo("666", "捡田螺的小男孩", 27); //一般是查数据库，或者远程调用返回的
    }
}